//
//  WQSceneNormalCollectionCell.m
//  WisdomQuestor
//
//  Created by 纪景城 on 2024/12/18.
//

#import "WQSceneNormalCollectionCell.h"

@implementation WQSceneNormalCollectionCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.cornerRadius = kFragmemtFloat(15);
        self.backgroundColor = UIColor.whiteColor;
        
        [self.contentView addSubviews:[NSArray arrayWithObjects:self.sceneTypeImageView, self.moreThreeButton, self.sceneNameLabel, nil]];
        [self fragmentUI_ViewSet];
    }
    return self;
}

#pragma mark ------- Lazy Methods -------

- (void)fragmentUI_ViewSet {
    [self.sceneTypeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(kFragmemtFloat(15));
        make.top.equalTo(self.contentView.mas_top).offset(kFragmemtFloat(15));
        make.size.mas_equalTo(kSizzleKapadate(32, 32));
    }];
    [self.moreThreeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-kFragmemtFloat(15));
        make.top.equalTo(self.contentView.mas_top).offset(kFragmemtFloat(10));
        make.size.mas_equalTo(kSizzleKapadate(22, 22));
    }];
    [self.sceneNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(kFragmemtFloat(15));
        make.right.equalTo(self.contentView.mas_right).offset(-kFragmemtFloat(15));
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-kFragmemtFloat(18));
    }];
}

- (UIImageView *)sceneTypeImageView {
    if (!_sceneTypeImageView) {
        _sceneTypeImageView = [[UIImageView alloc] initWithImage:kImageName(@"scene_status_backhome")];
    }
    return _sceneTypeImageView;
}

- (UIButton *)moreThreeButton {
    if (!_moreThreeButton) {
        _moreThreeButton = [UIButton initWithImage:kImageName(@"scene_more_threedian") selectedImage:nil];
    }
    return _moreThreeButton;
}

- (UILabel *)sceneNameLabel {
    if (!_sceneNameLabel) {
        _sceneNameLabel = [UILabel initWithTextColor:k_Color_666666 weight:UIFontWeightMedium size:14];
    }
    return _sceneNameLabel;
}

@end
